https://glot.io/snippets/gi8fdt7tzi/raw/main.lua